﻿// Copyright 2005, 2006 - Morten Nielsen (www.iter.dk)
//
// This file is part of SharpMap.
// SharpMap is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// 
// SharpMap is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.

// You should have received a copy of the GNU Lesser General Public License
// along with SharpMap; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 

using System;
using System.Runtime.Serialization;


namespace Petra.Gis.ReferenceSystemServices
{
  /// <summary>
  /// Details of axis. This is used to label axes, and indicate the orientation.
  /// </summary>
  [DataContract(Name="AXIS")]
  public partial class Axis
  {

    /// <summary>
    /// xaml constructor
    /// </summary>
    public Axis(){ }




    /// <summary>
    /// Initializes a new instance of an AxisInfo.
    /// </summary>
    /// <param name="name">Name of axis</param>
    /// <param name="orientation">Axis orientation</param>
    public Axis(string name, OrientationType orientation)
    {
      Name = name;
      Orientation = orientation;
    }




    //protected string _Name;

    /// <summary>
    /// Human readable name for axis. Possible values are X, Y, Long, Lat or any other short string.
    /// </summary>
    [DataMember(Name="NAME", Order = 1)]
    public string Name
    { get; set; }





    //protected AxisOrientationType _Orientation;

    /// <summary>
    /// Gets enumerated value for orientation.
    /// </summary>
    //[DataMember(Name="ORIENTATION", Order = 2)]
    public OrientationType Orientation
    { get; set; }





    /// <summary>
    /// json specific serialize property. MS Json serializes enum as number, not as string
    /// </summary>
    [DataMember(Name = "ORIENTATION", Order = 2)]
    public string strOrientation
    {
      get { return Enum.GetName(typeof(OrientationType), this.Orientation); }
      set { this.Orientation = (OrientationType)Enum.Parse(typeof(OrientationType), value); }
    }


  }
}
